Skip to content

gh-154037: Fix race in the Decimal.__hash__() - #154045

Merged
kumaraditya303 merged 3 commits into
python:mainfrom
skirpichev:fix-race-in-Decimal-hash/154037
Jul 30, 2026
Merged

gh-154037: Fix race in the Decimal.__hash__()#154045
kumaraditya303 merged 3 commits into
python:mainfrom
skirpichev:fix-race-in-Decimal-hash/154037

Conversation

@skirpichev

@skirpichev skirpichev commented Jul 19, 2026

Copy link
Copy Markdown
Member

@skirpichev

Copy link
Copy Markdown
Member Author

I think it's safe enough to backport. Though, I doubt it worth: this patch just prevents hash recomputing in some cases.

@encukou

encukou commented Jul 19, 2026

Copy link
Copy Markdown
Member

Does the compiler always optimize the duplicate ATOMIC_LOAD?

@skirpichev

Copy link
Copy Markdown
Member Author

Does the compiler always optimize the duplicate ATOMIC_LOAD?

Well, maybe some not. Lets use a local variable, anyway.

@kumaraditya303
kumaraditya303 enabled auto-merge (squash) July 30, 2026 15:02
@kumaraditya303
kumaraditya303 merged commit 2f381f5 into python:main Jul 30, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants